package test.wendellup.bootStrap.dao;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import cn.egame.common.exception.ExceptionCommonBase;
import cn.wendellup.bootStrap.dao.contract.IAdvDao;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/applicationContext.xml"})
public class TesAdvDao {

	@Autowired
    private IAdvDao advDaoImpl;

	@Test
	public void testGetAdvDetailById() throws ExceptionCommonBase{
//		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
//		System.out.println(ac);
//		IUserDao userDaoImpl = ac.getBean(UserDaoImpl.class);
		System.out.println(advDaoImpl.getAdvDetailById(1));
	}
	
	@Test
	public void testGetAdvPositionById() throws ExceptionCommonBase{
//		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
//		System.out.println(ac);
//		IUserDao userDaoImpl = ac.getBean(UserDaoImpl.class);
		System.out.println(advDaoImpl.getAdvPositionById(1));
	}
	
	@Test
	public void testGetAdvPositionLinkByPositionAndAppId() throws ExceptionCommonBase{
//		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
//		System.out.println(ac);
//		IUserDao userDaoImpl = ac.getBean(UserDaoImpl.class);
		System.out.println(advDaoImpl.getAdvPositionLinkByPositionAndAppId(1, 201));
	}
}
